import React from 'react';
import GlobalContext from '../../util/GlobalContext';

export default function Child1() {
  return (
    <div>
      {/* 消费者 */}
      <GlobalContext.Consumer>
        {
          context => {
            return <div>
              <button onClick={ () => context.setMessage({name:'黄雁冰',age:'21',sex:'女'})}> 修改</button>
            </div>
          }
        }
      </GlobalContext.Consumer>
    </div>
  )
}
